package com.ruoyi.hospital.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.hospital.mapper.HospitalBedMapper;
import com.ruoyi.hospital.domain.HospitalBed;
import com.ruoyi.hospital.service.IHospitalBedService;

/**
 * 床位Service业务层处理
 * 
 * @author qichi
 * @date 2023-07-05
 */
@Service
public class HospitalBedServiceImpl implements IHospitalBedService 
{
    @Autowired
    private HospitalBedMapper hospitalBedMapper;

    /**
     * 查询床位
     * 
     * @param id 床位主键
     * @return 床位
     */
    @Override
    public HospitalBed selectHospitalBedById(Long id)
    {
        return hospitalBedMapper.selectHospitalBedById(id);
    }

    /**
     * 查询床位列表
     * 
     * @param hospitalBed 床位
     * @return 床位
     */
    @Override
    public List<HospitalBed> selectHospitalBedList(HospitalBed hospitalBed)
    {
        return hospitalBedMapper.selectHospitalBedList(hospitalBed);
    }

    /**
     * 新增床位
     * 
     * @param hospitalBed 床位
     * @return 结果
     */
    @Override
    public int insertHospitalBed(HospitalBed hospitalBed)
    {
        hospitalBed.setCreateTime(DateUtils.getNowDate());
        return hospitalBedMapper.insertHospitalBed(hospitalBed);
    }

    /**
     * 修改床位
     * 
     * @param hospitalBed 床位
     * @return 结果
     */
    @Override
    public int updateHospitalBed(HospitalBed hospitalBed)
    {
        hospitalBed.setUpdateTime(DateUtils.getNowDate());
        return hospitalBedMapper.updateHospitalBed(hospitalBed);
    }

    /**
     * 批量删除床位
     * 
     * @param ids 需要删除的床位主键
     * @return 结果
     */
    @Override
    public int deleteHospitalBedByIds(Long[] ids)
    {
        return hospitalBedMapper.deleteHospitalBedByIds(ids);
    }

    /**
     * 删除床位信息
     * 
     * @param id 床位主键
     * @return 结果
     */
    @Override
    public int deleteHospitalBedById(Long id)
    {
        return hospitalBedMapper.deleteHospitalBedById(id);
    }
}
